<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="app">
        姓名：<input type="text" v-model="person.name"><br>
        年龄：<input type="text" v-model="person.age">
        <input type="button" @click="person.age++" value="+"/><br>
        <h1>
            {{person.name}}今年{{person.age}}岁了。
        </h1>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var let=new Vue({
            el:"#app",
            data:{
                person:{
                    name:"Jack",
                    age:21
                }
            },
            watch:{
                person: {
                    deep:true,
                    handler(val) {
                        console.log(val.name);
                        console.log(val.age);
                    }
                }
            }
        })
    </script>
</body>
</html>